/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.cvut.fel.taskpro.view.controller;


import cz.cvut.fel.taskpro.business.imanager.IAssignmentBusiness;
import cz.cvut.fel.taskpro.business.imanager.IGroupBusiness;
import cz.cvut.fel.taskpro.business.imanager.ISubjectBusiness;
import cz.cvut.fel.taskpro.business.imanager.ITeamBusiness;
import cz.cvut.fel.taskpro.business.imanager.IUserBusiness;
import cz.cvut.fel.taskpro.business.imanager.IVersionBusiness;
import cz.cvut.fel.taskpro.data.entity.GroupTaskPro;
import cz.cvut.fel.taskpro.data.entity.Student;
import cz.cvut.fel.taskpro.data.entity.Subject;
import cz.cvut.fel.taskpro.data.entity.Team;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
 
/**
 *
 * @author Tom
 */
@ManagedBean(name = "rateTaskBean")
@ViewScoped
public class RateTaskController extends AbstractFileController implements Serializable{
    @EJB
    private IUserBusiness userB;
    @EJB
    private ISubjectBusiness subjectB;
    @EJB
    private ITeamBusiness teamB;
    @EJB
    private IGroupBusiness groupB;
    @EJB
    private IVersionBusiness versionB;
    @EJB
    private IAssignmentBusiness assignmentB;
    private List<GroupTaskPro> kantorGroup;
    private List<Team> kantorTeam;
    private Team [] selectedTeam;
    private GroupTaskPro[] selectedGroup;
    private Subject[] selectedSubject;
    boolean isFilterApply;
    @ManagedProperty(value="#{kantorTaskBean.kantorSubjects}")
    private List<Subject> kantorSubjects;
   
    @ManagedProperty(value="#{kantorTaskBean.kantorStudents}")
    private List<Student> kantorStudents;
    private Student [] selectedStudents;
    @PostConstruct
    public void init(){
        isFilterApply=false;
        recognizeLogin();
        kantorGroup=loggedKantor.getmGroups();
        kantorTeam=teamB.getTeamsByKantor(loggedKantor);
    }
     public List<Student> getKantorStudents() {
        return kantorStudents;
    }

    public List<GroupTaskPro> getKantorGroup() {
        return kantorGroup;
    }

    public void setKantorGroup(List<GroupTaskPro> kantorGroup) {
        this.kantorGroup = kantorGroup;
    }

    public List<Subject> getKantorSubjects() {
        return kantorSubjects;
    }

    public void setKantorSubjects(List<Subject> kantorSubjects) {
        this.kantorSubjects = kantorSubjects;
    }

    public List<Team> getKantorTeam() {
        return kantorTeam;
    }

    public void setKantorTeam(List<Team> kantorTeam) {
        this.kantorTeam = kantorTeam;
    }

    public GroupTaskPro[] getSelectedGroup() {
        return selectedGroup;
    }

    public void setSelectedGroup(GroupTaskPro[] selectedGroup) {
        this.selectedGroup = selectedGroup;
    }

    public Subject[] getSelectedSubject() {
        return selectedSubject;
    }

    public void setSelectedSubject(Subject[] selectedSubject) {
        this.selectedSubject = selectedSubject;
    }

    public Team[] getSelectedTeam() {
        return selectedTeam;
    }

    public void setSelectedTeam(Team[] selectedTeam) {
        this.selectedTeam = selectedTeam;
    }

    public void setKantorStudents(List<Student> kantorStudents) {
        this.kantorStudents = kantorStudents;
    }

    public Student[] getSelectedStudents() {
        return selectedStudents;
    }

    public void setSelectedStudents(Student[] selectedStudents) {
        this.selectedStudents = selectedStudents;
    }
    
}
